package banking;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User:恋恋
 * Date:2022-09-21
 * Time:9:08
 */
public class Account {
    private double balance;//这个属性保留了银行账户的当前（或即时）余额

    public Account(double balance) {
        this.balance = balance;
    }
    //该方法用户获取经常余额
   public double getBalance() {
        return balance;
    }
    //该方法向当前余额增加金额
    public void deposit(double amt){
        this.balance=this.balance+amt;
    }
    //该方法向当前余额减少金额
    public void withdraw(double amt){
        this.balance=this.balance-amt;
    }
}
